<header>
    <div class="head">
         <h2 class="title">千锋商城</h2>
         <marquee class="mar" >多一分优惠  多十分真诚 </marquee>

         <div class="haslogin">
             <p>欢迎你: <span class="user"> </span> <button class="logout" >退出</button></p> 
         </div>
         <div class="nologin">
            <p>你尚未登录,<a href="./login.html" class="gologin">请登录</a></p>
         </div>
    </div>
</header>

<script>
    $(".nologin").hide()
    $(".haslogin").hide()
    var user = getCookie("useraccount");
    if(user){
        $(".haslogin").show()
        $(".user").html(user);
    }else{
        $(".nologin").show()
    }
    $(".logout").click(exit);


    function exit(){
        delCookie("useraccount");
        location.reload();
    }
</script>
